<script>
    function myFunction() {
        var pass1 = document.getElementById("password").value;
        var pass2 = document.getElementById("confirmpassword").value;
        if (pass1 != pass2) {
            document.getElementById("password").style.borderColor = "#E34234";
            document.getElementById("confirmpassword").style.borderColor = "#E34234";
			$('#alert').show(500);
			$('#match').hide(500);
        }else{
			document.getElementById("password").style.borderColor = "#007d00";
            document.getElementById("confirmpassword").style.borderColor = "#007d00";
			$('#alert').hide(500);
			$('#match').show(500);
		}
    }
</script>
<script src="ajax/kabupaten.js" type="text/javascript"></script>
<div class="col-md-9">
  <!-- random product -->
  <div class="span12">
	<div class="outer-border nav-page-sidebar-p10">
	  <div class="nav-judul bg-texture margin-bottom">
		<span class="judul-sidebar">
		  Register Member
		</span>
	  <div class="clearfix"></div>
	  </div>

	  <div class="nav-page-sidebar-p10">
		<form class="form-horizontal" id="myform" role="form" action="daftar.aspx" method="post" onsubmit="return gsValidate('nama|telp|email|email|alamat|provinsi|kabupaten|kd_pos|password|confirmpassword','Nama Harus Diisi|Telp Harus Diisi|Email Harus Diisi||Alamat Harus Diisi|Provinsi Harus Dipilih|Kabupaten/Kota Harus Dipilih|Kode Pos Harus Diisi|Password Harus Diisi|Confirm Password Harus Diisi','required|required_numeric|required|email|required|required|required|required_numeric|required|required');">
		  <div class="form-group small">
			<label class="col-lg-3 control-label">Nama Lengkap</label>
			<div class="col-lg-9">
			  <input type="text" name="nama" id="nama" class="form-control input-sm" placeholder="Nama lengakap" maxlength="50">
			</div>
		  </div>
		  <div class="form-group small">
			<label class="col-lg-3 control-label">Tanggal Lahir</label>
			<div class="col-lg-9">
				<?php
				  $tgl = explode("-","$biodata[tgl_lahir]");
				  echo "<select name=tgl class=input-sm>";
					  for($i=1;$i<=31;$i++){
						echo "<option value=$i>$i</option>";
					  }
				  echo "</select>
				  <select name=bln class=input-sm>";
					  for($i=1;$i<=12;$i++){
						echo "<option value=$i>$i</option>";
					  }
				  echo "</select>
				  <select name=thn class=input-sm>";
					  for($i=1950;$i<=2020;$i++){
						echo "<option value=$i>$i</option>";
					  }
				?>
			  </select>
			</div>
		  </div>
		  <div class="form-group small">
			<label class="col-lg-3 control-label">No. Telp</label>
			<div class="col-lg-9">
			  <input type="text" name="telp" id="telp" class="form-control input-sm" placeholder="No. telp" maxlength="20">
			</div>
		  </div>
		  <div class="form-group small">
			<label class="col-lg-3 control-label">Email</label>
			<div class="col-lg-9">
			  <input type="email" name="email" id="email" class="form-control input-sm" placeholder="Email" maxlength="50">
			</div>
		  </div>
		  <div class="form-group small">
			<label class="col-lg-3 control-label">Alamat Lengkap</label>
			<div class="col-lg-9">
			  <input type="text" name="alamat" id="alamat" class="form-control input-sm" placeholder="Alamat lengkap" maxlength="200">
			</div>
		  </div>
		  <div class="form-group small">
			<label class="col-lg-3 control-label">Provinsi</label>
			<div class="col-lg-9">
			  <select class="form-control input-sm" name="provinsi" id="provinsi">
					<option value=""> - - Pilih Provinsi - - </option>
					<?php
						$provinsi = $koneksi->query("SELECT * from provinsi");
						while ($p = $provinsi->fetch(PDO::FETCH_ASSOC)){
							echo "<option value=$p[id_provinsi]>$p[provinsi]</option>";
						}
					?>
				</select>
			</div>
		  </div>
		  <div class="form-group small">
			<label class="col-lg-3 control-label">Kabupaten</label>
			<div class="col-lg-9">
			  <select class="form-control input-sm" name="kabupaten" id="kabupaten">
				<option value=""> - - Pilih Kota/Kabupaten - - </option>
			  </select>
			</div>
		  </div>
		  <div class="form-group small">
			<label class="col-lg-3 control-label">Kode Pos</label>
			<div class="col-lg-9">
			  <input type="text" name="kd_pos" id="kd_pos" class="form-control input-sm" placeholder="Kode pos">
			</div>
		  </div>
		  <div class="form-group small">
			<label class="col-lg-3 control-label">Password</label>
			<div class="col-lg-9">
			  <input type="password" name="password" id="password" class="form-control input-sm" placeholder="Password" maxlength="30">
			</div>
		  </div>
		  <div class="form-group small">
			<label class="col-lg-3 control-label">Re-Password</label>
			<div class="col-lg-9">
			  <input type="password" name="confirmpassword" id="confirmpassword" class="form-control input-sm" placeholder="Re-Password" onkeyup="myFunction();" maxlength="30">
			  <span id="alert" style="display:none; color: red;">
				<i>Confirm password harus sama dengan password</i>
			  </span>
			  <span id="match" style="display:none; color: green;">
				<i>Confirm password dengan password sesuai</i>
			  </span>
			</div>
		  </div>

		  <div class="form-group">
			<div class="col-lg-offset-3 col-lg-9">
			  <button type="reset" class="btn btn-default btn-sm">Reset</button>
			  <button type="submit" class="btn btn-danger btn-sm">Submit</button>
			</div>
		  </div>
		</form>
	  </div>
	  
	<div class="clearfix"></div>
	</div>
  <div class="clearfix"></div>
  </div>
  <!-- end random product -->

</div>